using System.Windows.Controls;
using KinonekoSoftware.Foundation.UI.Controls;

namespace KinonekoSoftware.ArkSpark.Controls
{
    public sealed class DocumentEditorItemPanel : VirtualizingStackPanel
    {
        protected override void OnIsItemsHostChanged(bool oldIsItemsHost, bool newIsItemsHost)
        {
            base.OnIsItemsHostChanged(oldIsItemsHost, newIsItemsHost);

            var itemsControl = Xaml.GetParent<ItemsControl>(this);

            if (itemsControl is DocumentEditor editor)
            {
                editor.ThisItemsPanel = this;
            }
            
        }
        
    }
}